from django.contrib import admin
from django.urls import path, include
from myapp1.views import home

# URL配置列表，用于定义整个Django项目的URL路由映射
# 每个path对象将URL模式映射到相应的视图函数或应用的URL配置
urlpatterns = [
    # 默认首页，将'/'路径映射到views.home视图函数，路由名称为'home'
    path('', home, name='home'),
    # 管理后台URL路由，将'/admin/'路径映射到Django自带的管理后台站点
    path('admin/', admin.site.urls, name='admin'),
    # 应用URL路由，将'/myapp1/'路径下的所有请求转发到myapp1应用的urls.py文件处理
    # 1.主路由配置： path('路由地址/',include( "子路URL", namespace='命名空间'),name='视图名称' ),
    path('myapp1/', include("myapp1.urls"), name='myapp1'),
    # path('myapp2/', include("myapp2.urls")),
    path('myapp2/', include("myapp2.urls",namespace='myapp2')),
    # path('myapp3/', include("myapp3.urls")),
    path('myapp3/', include("myapp3.urls",namespace='myapp3')),
    path('myapp4/', include("myapp4.urls")),
]
